<template>
  <div>
    <!-- <keep-alive include="HomeBnner"> -->
    <keep-alive>
    <!-- <keep-alive exclude="My"> -->
    <router-view></router-view>
    </keep-alive>
    <div v-show="showPlayer" style="height: 46px;"></div>
    <!-- <div v-show="$route.meta.tabbar" style="height: 46px;"></div> -->
    <van-tabbar v-model="active" active-color="#e4463b" placeholder inactive-color="#aaa">
      <van-tabbar-item replace to="/" icon="wap-home">首页</van-tabbar-item>
      <van-tabbar-item replace to="/home/my" icon="manager">我的</van-tabbar-item>
      <!-- <van-tabbar-item replace to="/home/test" icon="manager">测试</van-tabbar-item> -->
      <van-tabbar-item replace to="/home/video" icon="video">视频</van-tabbar-item>
      <van-tabbar-item replace to="/home/cloudVillage" icon="icon iconfont icon-yinle">云村</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script  type='module'>
// 事件总线
// import Bus from '../common/eventBus'
import { mapState } from 'vuex'

export default {
  name: 'Home',
  data () {
    return {
      active: 0
    }
  },
  computed: {
    ...mapState({
      showPlayer: state => (state.player.currentIndex >= 0)
    })
  },
  created () {
  },
  beforeDestroy () {
  },
  activated () {
    // 事件总线
    // Bus.$emit('homeDistance', 50)
    console.log('home被激活了')
  },
  deactivated () {
    // 事件总线
    // Bus.$emit('homeDistance', 0)
    console.log('home隐藏了')
  }
}
</script>

<style lang="less" scope>
</style>
